<script setup lang="ts">
import { http } from '@/api/request'
import { onMounted, ref } from 'vue'
import {useRoute} from "vue-router";
const route=useRoute()
const axios = new http()
const calcTime = ref(0)

onMounted(() => {
  const tk = route.query.token
  console.log(route)
  const tm = setInterval(() => {
    calcTime.value++
    axios.get('/active?token=' + tk)
  }, 500)
  setTimeout(() => {
    clearInterval(tm)
    console.log('清除定时器')
  }, 2500)
})
</script>

<template>
  <header>
  </header>
</template>

<style scoped lang="scss">
.btn-animate {
  position: relative;
  width: 130px;
  height: 40px;
  line-height: 40px;
  margin-right: 10px;
  border: none;
  border-radius: 5px;
  background: #027efb;
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.btn-animate__overlap-horizontal {
  z-index: 1;

  &::after {
    left: auto;
    right: 0;
  }

  &::before,
  &::after,
  & > span::before,
  & > span::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(144, 207, 91, 0.25);
    transition: 0.4s;
    z-index: -1;
  }

  & > span::before,
  & > span::after {
    transition-delay: 0.4s;
  }

  & > span::before {
    left: auto;
    right: 0;
  }

  &:hover {
    &::before,
    &::after,
    & > span::before,
    & > span::after {
      width: 100%;
    }
  }
}
</style>
